<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<div class="business-padding">
	<table cellpadding="0" cellspacing="0" border="0" class="infor-table">
		<tr>
			<td align="right">
				<input id="queryCreditApplyId" name="queryCreditApplyId" type="hidden" />
				<input id="creditQueryId" name="creditQueryId" type="hidden" />
				<input id="dealerId" name="dealerId" type="hidden" />
				<input id="customerId" name="customerId" type="hidden" />
				<label class="control-label np">客户姓名：</label>
			</td>
			<td>
				<div class="control-div np" id="customerName"></div>
			</td>
			<td align="right">
				<label class="control-label np">身份证号码：</label>
			</td>
			<td>
				<div class="control-div np" id="customerNo"></div>
			</td>
		</tr>
		<tr>
			<td align="right">
				<label class="control-label np">业务编号：</label>
			</td>
			<td>
				<div class="control-div np" id="busiCode"></div>
			</td>
		
			<td align="right">
				<label class="control-label">业务部门：</label>
			</td>
			<td>
				<div class="control-div np" id="orgName"></div>
			</td>
		</tr>
		
		<tr>
			<td align="right">
				<label class="control-label np">信贷专员：</label>
			</td>
			<td>
				<div class="control-div np" id="salesmanName"></div>
			</td>
			<td align="right">
				<label class="control-label np">订单类型：</label>
			</td>
			<td>
				<div class="control-div yes-green np" id="channelType"></div>
			</td>
		</tr>
		<tr>
			<td align="right">
				<label class="control-label np">经销商类别：</label>
			</td>
			<td>
				<div class="control-div np" id="dealerLevel" name="dealerLevel" ></div>
			</td>
			<td align="right">
				<label class="control-label np">经销商：</label>
			</td>
			<td>
				<div class="control-div np" id="dealerName" ></div>
			</td>
		</tr>
		
		<tr>
			<td align="right">
				<label class="control-label np">银行编号：</label>
			</td>
			<td>
				<div class="control-div np" id="orderno"></div>
			</td>
			<td align="right">
				<label class="control-label np">贷款银行：</label>
			</td>
			<td>
				<div class="control-div np" id="loanBankDisplay" name="" ></div>
			</td>
		</tr>
		<tr>	
			<td align="right">
				<label class="control-label">历史交易：</label>
			</td>
			<td colspan="5">
				<div class="control-div" id="historyBusiness"></div>
			</td>
		</tr>	
	</table>
</div>
<!-- public quote -->
<%@include file="/jsp/comm_js_include.jsp"%>
<script type="text/javascript">
	$(function(){
		$.dpAjax({
	          url: '${basePath}/YwBusinessCommonController/getCommonBusinessInfo',
	          data: {"busiId":$.getUrlData("busiId")},
	          success: function (datas) {
	        	  var ywBusinessLoan =  datas.ywBusinessLoan;
	        	  var ywBusinessDetail = datas.ywBusinessDetail;
	        	  if(ywBusinessLoan!=null){
	        		  $("#loanAmount").text(ywBusinessLoan.loanAmount);
		          	  $("#loanMonth").text(ywBusinessLoan.loanMonthDisplay);
		          	  $("#bankRate").text(showNumber((ywBusinessLoan.bankRate ? ywBusinessLoan.bankRate : 0 ) * 100, 4));
		          	  $("#stagesFee").text(showNumber(ywBusinessLoan.stagesFee));
		          	  $("#carPrice").text(showNumber(ywBusinessLoan.carPrice));
		          }
	        	  if(datas.ywOrdernoBank!=null){
	        		  $("#orderno").text(datas.ywOrdernoBank.ordeRno); 
	        	  }
	        	  if(ywBusinessDetail!=null){
		          	  $("#customerName").text(ywBusinessDetail.customerName);
		          	  $("#chnsname").val(ywBusinessDetail.customerName);
		          	  toPinying(ywBusinessDetail.customerName);
		          	  $("#customerNo").text(ywBusinessDetail.customerNo);
		          	  changeIdNo(ywBusinessDetail.customerNo);
		          	  $("#custcode").val(ywBusinessDetail.customerNo);
		          	  $("#busiCode").text(ywBusinessDetail.busiCode);
		          	  $("#orgName").text(ywBusinessDetail.orgName);
		          	  $("#salesmanName").text(ywBusinessDetail.salesmanName);
		          	  $("#dealerName").text(ywBusinessDetail.dealerName);
		          	  $("#channelType").text(ywBusinessDetail.channelTypeDisplay);
		          	  $("#dealerLevel").text(ywBusinessDetail.dealerLevelDisplay);
	        	  }
	          	  if(ywBusinessLoan!=null){
		          	  $("#loanBankDisplay").text(ywBusinessLoan.loanBankDisplay);
	          	  }
	        	  $("#historyBusiness").text(datas.historyBusiness);
	          }
	      });
	});
	
	
	function toPinying(name){
		$.dpAjax({
           show:false,
           url:'${basePath}/YwOpenCardHzicbcController/toPinYin',
           data:{"name":name},
           success: function(datas){
        	   if(datas.result && datas.result != ""){
        		   $("#engname").val(datas.result);
        	   }else{
        		   $("#engname").val("");
        	   }
           }
       });
	}
	
	function changeIdNo(UUserCard){
 		if(UUserCard != null && UUserCard != ''){
	 		var year = UUserCard.substring(6, 10); 
	 		var month = UUserCard.substring(10, 12); 
	 		var day = UUserCard.substring(12, 14); 
	 		$("#birthdate").val(year + '-'+ month + '-'+ day );
	 	}
 		else{
 			$("#birthdate").val("");
 		}
    }
</script>